#include<bits/stdc++.h>
using namespace std;
inline int read(){
	int x=0;bool f=0;char ch=getchar();
	while(ch<'0'||ch>'9')f^=(ch=='-'),ch=getchar();
	while('0'<=ch&&ch<='9')x=(x<<1)+(x<<3)+(ch^48),ch=getchar();
	return f?-x:x;
}
const int Maxn=1e5+5;
int n,m;
char s[Maxn],t[Maxn];
int sum[Maxn][2];
int sum1[Maxn][2];
vector<int>ans;
namespace sub1{
	int f[2005][2005];
	bool ok[2005][2005];
	int last[2];
	inline void out(int id){
		puts("YES");
		stack<int>stk;
		int j=m;
		while(id&&j){
			stk.push(id);
			id=f[id][j];j--;
		}while(!stk.empty())printf("%d ",stk.top()),stk.pop();
	}
	inline void solve(){
		ok[0][0]=1;
		for(int i=1;i<=n;i++){
			for(int j=1;j<=m;j++){
				if(s[i]!=t[j])continue;
				if(ok[i-1][j-1]){
					ok[i][j]=1;
					f[i][j]=i-1;continue;
				}
				if(ok[last[0]][j-1]){
					ok[i][j]=1;
					f[i][j]=last[0];continue;
				}
				if(ok[last[1]][j-1]){
					ok[i][j]=1;
					f[i][j]=last[1];continue;
				}
				if(last[0]+1<i&&ok[last[0]+1][j-1]){
					ok[i][j]=1;
					f[i][j]=last[0]+1;continue;
				}
				if(last[1]+1<i&&ok[last[1]+1][j-1]){
					ok[i][j]=1;
					f[i][j]=last[1]+1;continue;
				}
			}
			last[s[i]-'0']=i;
		}
//		for(int i=1;i<=n;i++)
//			for(int j=1;j<=m;j++)printf("ok[%d][%d]=%d\n",i,j,ok[i][j]);
		int pd=0;
		for(int i=n;i;i--){
			if(ok[i][m])out(i),exit(0);
			if(i<n&&(s[i]!=s[i+1]))break;
		}puts("NO");
	}
}
namespace sub2{
	int f[Maxn][25];
	bool ok[Maxn][25];
	int last[2];
	inline void out(int id){
		puts("YES");
		stack<int>stk;
		int j=m;
		while(id&&j){
			stk.push(id);
			id=f[id][j];j--;
		}while(!stk.empty())printf("%d ",stk.top()),stk.pop();
	}
	inline void solve(){
		ok[0][0]=1;
		for(int i=1;i<=n;i++){
			for(int j=1;j<=m;j++){
				if(s[i]!=t[j])continue;
				if(ok[i-1][j-1]){
					ok[i][j]=1;
					f[i][j]=i-1;continue;
				}
				if(ok[last[0]][j-1]){
					ok[i][j]=1;
					f[i][j]=last[0];continue;
				}
				if(ok[last[1]][j-1]){
					ok[i][j]=1;
					f[i][j]=last[1];continue;
				}
				if(last[0]+1<i&&ok[last[0]+1][j-1]){
					ok[i][j]=1;
					f[i][j]=last[0]+1;continue;
				}
				if(last[1]+1<i&&ok[last[1]+1][j-1]){
					ok[i][j]=1;
					f[i][j]=last[1]+1;continue;
				}
			}
			last[s[i]-'0']=i;
		}
//		for(int i=1;i<=n;i++)
//			for(int j=1;j<=m;j++)printf("ok[%d][%d]=%d\n",i,j,ok[i][j]);
		int pd=0;
		for(int i=n;i;i--){
			if(ok[i][m])out(i),exit(0);
			if(i<n&&(s[i]!=s[i+1]))break;
		}puts("NO");
	}
}
inline void solve(){
	ans.clear();
	for(int i=1;i<=n;i++)sum[i][0]=sum[i-1][0]+(s[i]=='0'),sum[i][1]=sum[i-1][1]+(s[i]=='1');
	for(int i=1;i<=m;i++)sum1[i][0]=sum1[i-1][0]+(t[i]=='0'),sum1[i][1]=sum1[i-1][1]+(t[i]=='1');
	int r=n;t[0]=114;
	for(int i=m;i;i--){
		if(t[i]!=t[i-1]){
			if(s[r]!=t[i]){
				while(r&&s[r]!=t[i])r--;
				if(r)ans.push_back(r),r--;
			}
			else{
				while(r&&s[r]==t[i])r--;
				r++;
				if(r)ans.push_back(r),r--;
			}
		}else{
			while(r&&s[r]!=t[i])r--;
			int rr=r;
			while(rr&&s[rr]==t[i])rr--;
			rr++;
			if(sum[rr-1][t[i]-'0']>=sum1[i-1][t[i]-'0']){
				if(r)ans.push_back(rr);
				r=rr-1;
				continue;
			}
			if(r)ans.push_back(r),r--;
		}
	}
	if(ans.size()<m)puts("NO"),exit(0);
	puts("YES");
	for(int i=m-1;~i;i--)printf("%d ",ans[i]);
}
int main(){
	freopen("seq.in","r",stdin);
	freopen("seq.out","w",stdout);
	scanf("%s",s+1);scanf("%s",t+1);
	n=strlen(s+1);m=strlen(t+1);
	if(n<=2000)sub1::solve(),exit(0);
	if(n<=1e5&&m<=20)sub2::solve(),exit(0);
	int l=1;
	for(int i=1;i<=n;i++){
		if(l<=m&&t[l]==s[i])l++,ans.push_back(i);
	}
	if(l!=m+1)puts("NO"),exit(0);
	int ok=0;
	for(int i=ans[m-1]+2;i<=n;i++)ok+=(s[i-1]!=s[i]);
	if(ok)solve(),exit(0);
	puts("YES");
	for(int i=0;i<m;i++)printf("%d ",ans[i]);
	return 0;
}
/*
0001101101
0110


0001110011001111
00110101


0001110011001111
010101

00110110111011011
1101100110


00110110111011011
101010
*/

